import requests as rs  # python发网络请求的模块(好用)
from bs4 import BeautifulSoup  # HTML解析

url = "http://docs.micropython.org/en/latest/library/ubinascii.html"

headers_ = {
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36'}
soup = BeautifulSoup(rs.get(url=url, headers=headers_).content, 'html.parser')
print(url+'\t'+soup.original_encoding)

titles = ["## "+x.replace("\n", "").replace("¶", "")
          for x in [x.text for x in soup.findAll(name="dt")]]
